import React from 'react'
import {Outlet,useNavigate} from 'react-router-dom'
export default function Home() {
    const Navigate = useNavigate()
    const getNews = () => {
        Navigate('/main/home/news/001/?name=老王',{
            state : [
                {id:'001',name:'黄渤'},
                {id:'002',name:'王宝强'},
                {id:'003',name:'黄晓明'},
              ]
        })
    }
    const getHobby = () => {
        Navigate('/main/home/hobby/002/?name=老王',{
             state: [
                { id: "001", name: "空间站国旗与地球同框" },
                { id: "002", name: "罗永浩谈钟薛高卖得贵" },
                { id: "003", name: "麦当劳员工将掉地上面包放回货架" },
              ]
        })
    }
  return (
    <div>
        <h3>我是Home的内容</h3>
        <button onClick = { getNews }>news</button>
        <button onClick = { getHobby }>hobby</button>
        <Outlet/>
    </div>
  )
}
